package LocalDate;

import java.time.LocalDate;
/*
*LocalDate成员方法(设置功能):
*   static LocalDate of(int year, int month, int dayOfMonth)自定义年月日
*    LocalDate withYear(int year) //设置指定日期的年
 *   LocalDate withMonth(int month)//设置月
 *   LocalDate withDayOfYear(int dayOfYear)//设置这一年第几天
 *   LocalDate withDayOfMonth(int dayOfMonth)//设置日
* */
public class LocalDateDemo02 {
    public static void main(String[] args) {
        //method01();
        LocalDate localDate = LocalDate.now().withYear(2015).withMonth(4).withDayOfMonth(10);
        System.out.println(localDate);

        LocalDate localDate1 = localDate.withDayOfYear(10);//设置当前年起的第10天(1月10号)
        System.out.println(localDate1);
    }

    private static void method01() {
        LocalDate localDate = LocalDate.of(2015, 3, 12);
        System.out.println(localDate);

        LocalDate localDate02 = localDate.withYear(2013);
        System.out.println(localDate02);

        LocalDate ld03 = localDate02.withMonth(4).withDayOfMonth(10);
        System.out.println(ld03);
    }
}
